# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=gx-go
pkgver=1.9.0
pkgrel=24
pkgdesc="A tool to use with the gx package manager for packages written in go"
url="https://github.com/whyrusleeping/gx-go"
# riscv64: dependency github.com/minio/sha512-simd does not support riscv64
arch="all !riscv64"
license="MIT"
options="!check net" # Test suite issues
makedepends="go"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/whyrusleeping/gx-go/archive/v$pkgver.tar.gz
	gomod.patch
	"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

prepare() {
	default_prepare
	go mod download
}

build() {
	go build -o bin/gx-go
}

package() {
	install -Dm 755 bin/gx-go "$pkgdir/usr/bin/gx-go"

	install -Dm 644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
}

sha512sums="
3df8a99d257098afdf99ba6cbf58d50eab196f823ae53db48865a4f4962e38b84a66ffc99d5a342b43ff9891c8245252a77677b75c770d86f93ef1ad3c9e879f  gx-go-1.9.0.tar.gz
f7678e3ec2092ab9f4a78097dcaa892acb6288bf680c6f992b789d35d241e575d181d53c32e53b19e07ff6c793aed2188b5856c021287b2204eff82c78683e2f  gomod.patch
"
